Programming - Intro to Variables

OPENING QUESTIONS: 

Emergency medicine sometimes employs a process known as 'triage'. Especially in situations where there are mass casualties, the ER physicians have to determine who gets treated first based on the seriousness of the injuries of the people effected.

Let's consider Friday's coding project a situation in need of 'triage'. What do I mean by that and how would you go about doing that in a timely matter during a testing situation. Work with your team to determine a course of action to do just that.

LEARNING TARGET: I will work with my team to differentiate between time consuming tasks on a programming assignment during today's class.

I will be able to use basic variables during today's class.

COURSE DOCUMENT: Ver 1.70 is HERE

WORK O' THE DAY

There is a quick and simple way to get objects of similar types (for example labels and text boxes) on the screen *post haste* -- but only if formatting and placement are not an option.

Let's discuss.

What about unintended consequences? (I'll model)

 

The other aspect of the project to 'triage' is the difficulty of the programming aspect.

How would you triage that differently if it were a programming assignment and NOT a testing situation?

═══════════════════════════

Doing the actual programming of that assignment is kind of tricky:

  1. Nesting the if statements so that you can compare 3 'true' statements can be a bit weird (but very doable). In fact do that now.
  2. Working with the text that makes up the RGB block is TOUGH. Before we get back to that I'm going to learn you about the wonderful world of variables today!

Notice that we can always use the getText, getNumber, getChecked blocks as placeholders for the actual data they contain.

That can get kinda clunky, to say the least.

Sometimes we just get data from the user and need to store it somewhere convenient in our code so that we can manipulate it easily without always using those clunky blocks.

Now please go HERE and let's eyeball that code